package com.example.demo.controller;

import com.example.demo.entity.DemoEntity;
import com.example.demo.service.DemoService;
import com.example.demo.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @author xh
 * @Date 2022/10/3
 */
@RestController
public class ApiController {

    @Autowired
    DemoService demoService;

    @PostMapping("/match")
    public Result<List<DemoEntity>> matchUser(@RequestBody List<String> tags) {
        List<DemoEntity> demoEntities = demoService.matchUserByTags(tags);
        return new Result<List<DemoEntity>>().ok(demoEntities);
    }
}
